package com.jd.webapp.portal.controller;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jd.common.util.JsonUtils;
import com.jd.webapp.portal.service.ContentServiceDto;


@Controller
public class PageController {
	private static final long INDEX_ADV= 89L;
	@Autowired
	private ContentServiceDto contentService;
	
	@RequestMapping("/index")
	public String index(Model model){
		try {
			List<Map<String, Object>> list = contentService.getContentByCid(INDEX_ADV);
			String json = JsonUtils.objectToJson(list);
			model.addAttribute("ad1", json);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "index";
	}
}
